package com.jxwifi.cloud.quickclean.order;

import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.basicactivity.BasicActivity;
import com.idroid.utils.NoDoubleClickListener;
import com.jxwifi.cloud.quickclean.R;
import com.jxwifi.cloud.quickclean.app.ClientBasicActivity;

/**
 * Created by Administrator on 2019/6/5.
 */

public class TextActivity extends ClientBasicActivity {
    private DrawerLayout mDrawerLayout;
    private TextView tv_anniu_caozuo;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text);
       /* mDrawerLayout= (DrawerLayout) findViewById(R.id.drawer_layout);
        NavigationView navView= (NavigationView) findViewById(R.id.nav_view);
        tv_anniu_caozuo=(TextView)findViewById(R.id.tv_anniu_caozuo);
        //navView.setCheckedItem(R.id.nav_call);//选中操作
        navView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener(){

            @Override
            public boolean onNavigationItemSelected(MenuItem menuItem) {

                switch (menuItem.getItemId()){
                    case R.id.nav_call:
                        Toast.makeText(TextActivity.this,"点击的是call",Toast.LENGTH_SHORT).show();
                        break;
                    case R.id.nav_mail:
                        Toast.makeText(TextActivity.this,"点击的是mail",Toast.LENGTH_SHORT).show();
                        break;
                    case R.id.nav_friends:
                        Toast.makeText(TextActivity.this,"点击的是friends",Toast.LENGTH_SHORT).show();
                        break;
                    case R.id.nav_location:
                        Toast.makeText(TextActivity.this,"点击的是location",Toast.LENGTH_SHORT).show();
                        break;
                    case R.id.nav_task:
                        Toast.makeText(TextActivity.this,"点击的是tast",Toast.LENGTH_SHORT).show();
                        break;

                }
                mDrawerLayout.closeDrawers();
                return false;
            }
        });
        tv_anniu_caozuo.setOnClickListener(new NoDoubleClickListener() {
            @Override
            protected void onNoDoubleClick(View v) {
                mDrawerLayout.openDrawer(GravityCompat.START);
            }
        });*/
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()){
            case R.id.backup:
                Toast.makeText(this,"clicked BackUp",Toast.LENGTH_SHORT).show();
                break;
            case R.id.delete:
                Toast.makeText(this,"clicked delete",Toast.LENGTH_SHORT).show();
                break;
            case R.id.action_settings:
                Toast.makeText(this,"clicked action_settings",Toast.LENGTH_SHORT).show();
                break;
            case android.R.id.home:
                mDrawerLayout.openDrawer(GravityCompat.START);
                break;
        }
        return true;
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_main,menu);
        return true;
    }

}
